﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataBaseTool
{
    class SQLITEUtils
    {
        public SQLITEUtils()
        {

        }
        public static Type SQLITE_type(string type)
        {
            Type t = typeof(Object);
            switch (type)
            {
                case "INTEGER":
                    t = typeof(Int64);
                    break;
                case "TEXT":
                    t = typeof(string);
                    break;
                case "REAL":
                    t = typeof(Double);
                    break;
                case "BLOB":
                    t = typeof(System.Byte[]);
                    break;
            }
            return t;

        }

        public static DbType  db_type(string type)
        {
            DbType t = DbType.Object;//默认为Object
            switch (type)
            {
                case "INTEGER":
                    t = DbType.Int64;
                    break;

                case "TEXT":
                    t = DbType.String;
                    break;

                case "REAL":
                    t = DbType.Double;
                    break;

                case "BLOB":
                    t = DbType.Binary;
                    break;
            }
            return t;

        }


    }
}
